#include <STC8H.h>
#include "fun.h"
#include "STDIO.H"
#include "eeprom.h"

void dma_int(void) interrupt 13
{
        DMA_UR1T_STA&=~0x01;
        DMA_UR1T_CR=0x00;
}
void Delay1000ms(void)	//@11.0592MHz
{
	unsigned char data i, j, k;

	i = 57;
	j = 27;
	k = 112;
	do
	{
		do
		{
			while (--k);
		} while (--j);
	} while (--i);
}
void main()
{
    char n =0;
    char xdata cacheu1[256];
    unsigned long i;
    P_SW2|=0x80;
    for(i=0;i<256;i++){
        cacheu1[i]=i;
    }
    Uart1_Init();

    EA=1;
    for(i=0;i<64;i++){
        cacheu1[i]=i;
    }
    i = &cacheu1[48];
    UartSendStr("start!!!");
    UartSend(i>>8);
    UartSend(i&0xff);
    DMA_UR1T_CFG=0x80;
    DMA_UR1T_STA=0x00;
    DMA_UR1T_AMT=31;
    DMA_UR1T_TXAH=(i>>8);
    DMA_UR1T_TXAL=(i&0xff);
    DMA_UR1T_CR=0x80;
    Delay1000ms();
    DMA_UR1T_CR=0xc0;
    while (1)
    {       UartSendStr("r!!!");
            Delay1000ms();
            DMA_UR1T_CR=0xc0;
    }
}